﻿@inherits LayoutComponentBase
@inject GlobalConfig GlobalConfig
@inject IMasaStackConfig MasaStackConfig

<SLayout OnErrorAsync="OnError"
         Logo="https://cdn.masastack.com/stack/images/logo/MASAStack/logo-h-en.png"
         MiniLogo="https://cdn.masastack.com/stack/images/logo/MASAStack/logo.png"
         IsShowEnvironmentSwitch
         WhiteUris="_whiteUrlRoutes">
    @Body
</SLayout>

@code {
    [Inject]
    public IPopupService PopupService { get; set; } = default!;

    [Inject]
    public IHostEnvironment HostEnvironment { get; set; }

    Task OnError(Exception exception)
    {
        PopupService.EnqueueSnackbarAsync(exception.Message, AlertTypes.Error);
        return Task.CompletedTask;
    }

    private readonly List<string> _whiteUrlRoutes = new()
    {
        // for scheduler logs jump
        "log/*",
        "trace/*",
        // for instrument like serviceList,endpointList,instanceList  jump to child instrument
        "dashboard/*",
        "teamDetail/*"
    };
}